#ifndef PBM_H__
#define PBM_H__

#include "pb.h"
#include "pbd.h"

// response
void pbm_negative_response(pbd_err_code_t err_code, pb_tx_array_handle_t cb);
void pbm_positive_response(pbd_command_t command, pb_tx_array_handle_t cb);

// profile 
void pbm_profile_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);

// application
void pbm_application_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb); 

// control 
void pbm_control_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_control_battery_status_notify(uint8_t charging_status, uint8_t level,  uint16_t voltage, pb_tx_array_handle_t cb);
void pbm_control_measure_res_upload_heartrate(uint8_t state, uint8_t bpm, pb_tx_array_handle_t cb); 
void pbm_control_measure_res_upload_heartate_advance( uint8_t* pdata, uint16_t len, pb_tx_array_handle_t cb);
void pbm_control_measure_res_upload_bp(uint8_t state, uint8_t sbp, uint8_t dbp, pb_tx_array_handle_t cb);
void pbm_control_measure_res_upload_temperature(uint8_t state, int16_t temp, pb_tx_array_handle_t cb); 

void pbm_control_findme( pb_tx_array_handle_t cb);
void pbm_control_camera_take_photo(pb_tx_array_handle_t cb);

// memory 
void pbm_memory_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb); 
void pbm_memory_tx_accel_fifo_data(uint8_t *data, uint16_t len, pb_tx_array_handle_t cb);
void pbm_memory_tx_tp_data(uint8_t* data, uint8_t len, pb_tx_array_handle_t cb); 
void pbm_memory_tx_hrs_fifo_data(uint8_t* pdata, uint16_t len, pb_tx_array_handle_t cb);

// record 
void pbm_record_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb); 
void pbm_record_notif_records_digest(uint32_t addr, uint32_t size, pb_tx_array_handle_t cb);

// resource
void pbm_resource_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb); 

void pbm_download_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_upload_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb );

// dfu 
void pbm_dfu_command_init_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_write_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_execute_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_query_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_reset_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_mtu_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_command_version_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);
void pbm_dfu_dfu_init_ok(pb_tx_array_handle_t cb); 

// system 
void pbm_system_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);

// factory test 
void pb_factory_test_command_consume(pb_msg_t *p_msg, pb_tx_array_handle_t cb);

#endif // !PBM_H__
